<#include "/main.ftl"/>
<@diamondNav/>

<body>

<div id="content-wrapper" style="margin-left: 13%">
    <div style="margin-top: 5%;margin-left: 1%;width: 100%">

       <#if projectShareNode.id??>
            <form action="/projectShareController/updateProjectShare"
       <#else >
             <form action="/projectShareController/addProjectShare"
       </#if>
                   method="post" id="myForm" class="form-horizontal" >
        <div class="form-group">
            <div class="form-group">
                <label for="users" class="control-label col-md-2">用户列表</label>
                <div class="col-md-3">
                <select name="userId"  id="userNames" class="selectpicker show-tick form-control"  data-width="98%" data-first-option="false"
                        title='请选择用户(必选)' required data-live-search="true">
                    <#list userList as user>
                             <option value="${user.userId}">${user.userName!}</option>
                    </#list>
                </select>
                </div>
            </div>
        </div>
        <div>
            <input type="hidden" name="pageName" value="ProjectMemberPage">
            <input name="id" type="hidden" value="<#if projectShareNode??>${projectShareNode.id!}</#if>">
            <input name="shareType"  type="hidden" value="1">
            <input name="projectId" id="projectId" type="hidden"
                   value="${projectId!}">
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <button type="button" class="btn btn-success " id="back">
                    返回
                </button>
                <button type="submit" class="btn btn-success">
                    提交
                </button>
            </div>
        </div>
    </form>
    </div>
</div>
</body>

<script type="text/javascript">
    $("#back").click(function () {
        var projectId =$("#projectId").val();
        window.location.href = "/projectShareController/projectSharePage?shareType=1&projectId="+projectId;
    })
</script>